/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
		       Matthias Butz <matze@odinms.de>
		       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation version 3 as published by
    the Free Software Foundation. You may not use, modify or distribute
    this program under any other version of the GNU Affero General Public
    License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
var setupTask;

function init() {
    scheduleNew();
}

function scheduleNew() {
    var cal = java.util.Calendar.getInstance();
    cal.set(java.util.Calendar.HOUR, 0);
    cal.set(java.util.Calendar.MINUTE, 0);
    cal.set(java.util.Calendar.SECOND, 0);
    var nextTime = cal.getTimeInMillis();
    while (nextTime <= java.lang.System.currentTimeMillis())
        nextTime += 300 * 1000;
    setupTask = em.scheduleAtTimestamp("start", nextTime);
}

function cancelSchedule() {
    setupTask.cancel(true);
}

function start() {
    scheduleNew();
    var Message = new Array("Please Vote every 12 hours if you want people!", 
	"See a Hacker? Report him doing @gm <message> or screenshot it and post it under discuss or support or media",
	"Dont be an Asshole or you will get Jailed",
	"Want to be a GM please dont ask because you will for sure get jailed do again you get muted!",
	"@emo - makes you a GM please do it!",
	"Want to hack? GET BAN HAMMER ON YOUR ASS!",
	"Achievement system has secret achievements if you unlock, it gives double the NX",
	"We have a YouTube Channel, Do us a favor and subcribe to it, Its Holdenms2009",
	"Level 200 and bored, Reborn by doing @reborn or @rebirth there the same",
	"Events happen at random sometimes, stay on and you will see what they are",
	"Found a bug? report it to L337 or post it under Support",
	"Have screenshots? post it on the Media section of the Forums",
	"MTS works but Free Market in the Forums are better",
	"Donate to us for a 24/7 fast server and Domain of holdenms.org",
	"Our website is http://hdpgaming.rr.nu and the forums are http://holdenms.ulmb.com/",
	"You can swear, But! dont tease, make fun of, or harass other players or GMs",
	"Dont know how to Job Advance, do @cody, he is a Job Advancer and Teleporter",
	"Have a suggestion? Say it to L337 or say it under the suggetion section",
	"Rates of this server is 75x EXP/8x Drop/10x Mesos, There doubled on the weekends and hoildays",
	"Your Birthday Coming up? we will do a worldwide notice to that on HoldenMs for 10Million Mesos",
	"Want to do Shoutouts to People? we will do a Worldwide notice of it on HoldenMs for 100 Million Mesos",
	"Our Server is backing up everyday, every 6 hours",
	"@skillmaxer - maxes your skills!");
    em.getChannelServer().yellowWorldMessage("[HoldenMs] " + Message[Math.floor(Math.random() * Message.length)]);
}